namespace DotConferenceSql
{
    /// <summary>
    /// a simple FROM clause element
    /// </summary>
    public class FromTableQueryElement : QueryElementBase
    {
        private string m_table;

        /// <summary>
        /// Initializes a new instance of the <see cref="FromTableQueryElement"/> class.
        /// </summary>
        /// <param name="table">The table.</param>
        public FromTableQueryElement(string table)
            : base()
        {
            m_table = table;
            Type = QueryElementType.FromClause;
        }

        /// <summary>
        /// Generate the part of the query for this element.
        /// </summary>
        /// <returns>generated SQL fragment</returns>
        public override string BuildTextQuery()
        {
            return m_table;
        }
    }
}